package com.core.dao.jdbcmysql;


import com.core.bean.ShoppingOrder;
import com.core.dao.IShoppingOrderDao;
import com.core.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

public class ShoppingOrderDao implements IShoppingOrderDao {

    private static IShoppingOrderDao iShoppingOrderDao;

    static{
        SqlSession session = MybatisUtils.getSession();
        iShoppingOrderDao = session.getMapper(IShoppingOrderDao.class);
    }

    @Override
    public int add(ShoppingOrder entity) throws Exception {
        return iShoppingOrderDao.add(entity);
    }

    @Override
    public int remove(String id) throws Exception {
        return iShoppingOrderDao.remove(id);
    }

    @Override
    public int modify(ShoppingOrder entity) throws Exception {
        return iShoppingOrderDao.modify(entity);
    }

    @Override
    public ShoppingOrder findEntityById(String id) throws Exception {
        return iShoppingOrderDao.findEntityById(id);
    }
}
